<!DOCTYPE html>
<html>
<head>
    <title> 智能家居 随心所控</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
    <meta name="description" content="{$site_info.site_seo_description|default=''}">
    <include file="public@head"/>
    <link href="__TMPL__/public/assets/css/slippry/slippry.css" rel="stylesheet">
    <link href="__TMPL__/public/assets/css/banner.css" rel="stylesheet">
    <hook name="before_head_end"/>
</head>
<body class="body-white">
<include file="public@nav"/>
<div class="product_list_container">
    <div class="main clear">
        <nav class="top_nav" id="top_nav">
            <ul class="clear nav">
                <volist name="type" id="vo">
                <li onclick="selectProductByChina(this,{$vo.id});" data-tab="4">
                    <a href="{:cmf_url('List/index',array('id'=>$vo['parent_id'],'cid'=>$vo['id']))}">
                        <!-- <img src="http://img.orvibo.com/upload/productType2/productType2_1499407590645.png" alt="欧瑞博" class="icon ic_default">
                        <img src="http://img.orvibo.com/upload/productType2/productType2_1499407606632.png" alt="欧瑞博" class="icon ic_active"> -->
                        {$vo.name}</a>
                </li>
                </volist>
            </ul>
        </nav>


        <div class="list" data-id="4">
            <ul class="clear">
                <volist name="list" id="vo">
                    <php> $vo['more']=json_decode($vo['more'],true)</php>
                <li>
                    <div>
                        <if condition="empty($vo.more.thumbnail)">
                            <img src="__TMPL__/public/assets/images/default_tupian4.png"
                                  alt="{$vo.post_title}"/>
                            <else/>
                            <img src="{:cmf_get_image_url($vo.more.thumbnail)}"
                                style="width: 250px;height: 250px" alt="{$vo.post_title}"/>
                        </if>
                        <p class="p_name" style="margin-top: 30px">{$vo.post_title}</p>
                        <a class="detail" href="{:cmf_url('Article/index',array('id'=>$vo['post_id'],'cid'=>$category['id']))}">查看详情</a>
                        <a class="cover" href="{:cmf_url('Article/index',array('id'=>$vo['post_id'],'cid'=>$category['id']))}"></a>
                    </div>
                </li>
                </volist>
            </ul>
            <div class="pagination" style="margin-left: 45%;">
            {$list->render()}
            </div>
        </div>
    </div>
</div>

<include file="public@footer"/>
<script type="text/javascript" src=//js.orvibo.com/guanwang_second/front/bower_components/jquery/dist/jquery.min.js?v=1506393719766></script>

<script type="text/javascript" src=//js.orvibo.com/guanwang_second/front/js/common_ch.js?v=1506393719766></script>

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M3846GP"
                  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

<script>
    !(function($){
        var height = document.body.clientHeight || document.documentElement.clientHeight || 0;
        $(".pc_list li a").click(function(){
            $(".pc_list li").each(function(){
                if ($(this).hasClass("pc_active")){
                    $(this).removeClass("pc_active");
                };
            });
            $(this).parent().addClass('pc_active');
        });
        $(".cross_link").click(function(){
            $(".vertical_link").removeClass('ps_active');
            $(this).addClass('ps_active');
            $(".pc_list li").each(function(){
                var name = $(this).find("a").attr("href");
                if (name.indexOf("_") >= 0){
                    $(this).find("a").attr({"href":name.split(name.length-1)});
                };
            });
            $(".vertical_list").hide();
            $(".cross_list").show();
            height = document.body.clientHeight || document.documentElement.clientHeight || 0;
        });
        $(".vertical_link").click(function(){
            $(".cross_link").removeClass('ps_active');
            $(this).addClass('ps_active');
            $(".pc_list li").each(function(){
                var name = $(this).find("a").attr("href");
                $(this).find("a").attr({"href":name+"_"});
            });
            $(".cross_list").hide();
            $(".vertical_list").show();
            height = document.body.clientHeight || document.documentElement.clientHeight || 0;
        });
        $(window).scroll(function(event) {
            var scroll = $(window).scrollTop();
            $(".pc_list li").each(function(){
                var id = $(this).find("a").attr("href");
                if($(id).offset().top - $(window).scrollTop() <= 120 && $(id).offset().top - $(window).scrollTop() >= 0){
                    $(".pc_list li").each(function(){
                        if ($(this).hasClass("pc_active")){
                            $(this).removeClass("pc_active");
                        };
                    });
                    $(this).addClass("pc_active");
                };
            });
            if (scroll >= 500 && scroll < height - 1000){
                $(".pc_list").css({"margin-top": scroll - 500 +'px'});
            };
        });
    })(jQuery);

    function selectProductByType(obj,id){
        var isChina = $("#isChina").val();
        $(obj).addClass("cur");
        $(obj).siblings().removeClass("cur");
        console.info(id);
        var products_list = $(".products_list_"+id);
        if(id==''){
            //全部产品
            $('.products_list').each(function(){
                $(this).show();
            });
        }else{
            products_list.siblings().hide();
            products_list.show();
        };
    };
    $(document).ready(function () {
        var arr = document.location.href.split("#")
        var $list = $(".product_list_container .list")
        if (arr.length == 1){
            $list.eq(0).show()
            $("#top_nav .nav>li").eq(0).addClass('active')
        } else {
            for (var i = 0; i < $list.length; i++){
                if ($list.eq(i).attr("data-id") == arr[1]){
                    $list.eq(i).show()
                    break;
                }
            }
            var lis = $("#top_nav .nav>li")
            for(var i = 0; i < lis.length; i++){
                if (lis.eq(i).attr("data-tab") == arr[1]){
                    lis.eq(i).addClass('active')
                    break;
                }
            }
        }
        $('html').scrollTop(0);
        $('body').scrollTop(0);
        $(document).scrollTop(0);
    })
    function selectProductByChina(obj,id){
        var $list = $(".product_list_container .list")
        $("#top_nav .nav>li").removeClass("active");
        $(obj).addClass("active");
        $list.hide();
        for (var i = 0; i < $list.length; i++){
            if ($list.eq(i).attr("data-id") == id){
                $list.eq(i).show()
                break;
            }
        }
    }
</script>
